package com.spsoft.vatoutinv.model.vo.statistics;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.spsoft.vatoutinv.annotation.Translate;
import com.spsoft.vatoutinv.constants.DictConstant;
import com.spsoft.vatoutinv.constants.TranslateConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author wangy
 * @date 2024/6/19 13:28
 */
@Data
@ApiModel(value = "统计相关-发票信息统计返回对象")
public class InvoiceInfoVo {

    @ApiModelProperty(value = "所辖机构")
    private String sxjg;

    @ApiModelProperty(value = "发票状态")
    @Translate(type = TranslateConstant.DICT, value = DictConstant.VMS_FPZT)
    private String fpzt;

    @ApiModelProperty(value = "发票类型")
    @Translate(type = TranslateConstant.DICT, value = DictConstant.VMS_FPLX)
    private String fplx;

    @ApiModelProperty(value = "开票月份")
    private String kpyf;

    @ApiModelProperty(value = "金额(不含税)")
    @JsonSerialize(using = ToStringSerializer.class) // 对数字的正确 json序列化, 不会出现问题. -- 这个注解来自Jackson库，用于控制Java对象序列化为JSON字符串时的行为。在这里，ToStringSerializer.class 表示将对象的toString()方法结果用作序列化的值。这对于BigDecimal这样的对象很有用，因为它可以确保数值以字符串形式被正确地序列化，从而避免精度丢失的问题。
    private BigDecimal bhsje;

    @ApiModelProperty(value = "税率")
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal sl;

    @ApiModelProperty(value = "税额")
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal se;

    @ApiModelProperty(value = "金额(含税)")
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal hsje;

}
